package com.laozhao.deliveryManager.view.master;


import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

import com.laozhao.deliveryManager.zgui.ZPanel;

public class CustomerPanel extends ZPanel {
	private JTextField textField;
	private JTable table;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;
	private JTextField textField_4;
	private JTextField textField_5;

	/**
	 * Create the panel.
	 */
	public CustomerPanel() {
		setLayout(new BorderLayout(0, 0));
		
		JPanel panel = new JPanel();
		add(panel, BorderLayout.NORTH);
		panel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
		
		textField = new JTextField();
		panel.add(textField);
		textField.setColumns(10);
		
		JButton button = new JButton("检索");
		panel.add(button);
		
		JScrollPane scrollPane = new JScrollPane();
		add(scrollPane, BorderLayout.CENTER);
		
		table = new JTable();
		scrollPane.setViewportView(table);
		
		JPanel panel_1 = new JPanel();
		add(panel_1, BorderLayout.EAST);
		panel_1.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_2 = new JPanel();
		add(panel_2, BorderLayout.SOUTH);
		
		GridBagLayout gbLayout = new GridBagLayout();
//		gbLayout.columnWidths = new int[]{450, 0};
//		gbLayout.rowHeights = new int[]{20, 20, 20, 0};
//		gbLayout.columnWeights = new double[]{0.0, Double.MIN_VALUE};
//		gbLayout.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
		panel_2.setLayout(gbLayout);
		
//		JPanel panel_3 = new JPanel();
		GridBagConstraints gbCon = new GridBagConstraints();
		gbCon.fill = GridBagConstraints.BOTH;
		gbCon.insets = new Insets(0, 0, 5, 0);
//		gbc_panel_3.gridx = 0;
//		gbc_panel_3.gridy = 0;
//		panel_2.add(panel_2, gbc_panel_3);
//		panel_2.setLayout(new GridLayout(0, 4, 0, 0));
		
		JLabel lblNewLabel = new JLabel("编码");
		gbLayout.setConstraints(lblNewLabel, gbCon);
		panel_2.add(lblNewLabel);
		lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);
		
		textField_1 = new JTextField();
		gbLayout.setConstraints(textField_1, gbCon);
		panel_2.add(textField_1);
		textField_1.setColumns(8);
		
		JLabel lblNewLabel_1 = new JLabel("名称");
		gbLayout.setConstraints(lblNewLabel_1, gbCon);
		panel_2.add(lblNewLabel_1);
		lblNewLabel_1.setHorizontalAlignment(SwingConstants.RIGHT);
		
		textField_2 = new JTextField();
		gbCon.gridwidth = GridBagConstraints.REMAINDER;
		gbLayout.setConstraints(textField_2, gbCon);
		panel_2.add(textField_2);
		textField_2.setColumns(8);
		
//		JPanel panel_4 = new JPanel();
//		GridBagConstraints gbc_panel_4 = new GridBagConstraints();
//		gbc_panel_4.fill = GridBagConstraints.BOTH;
//		gbc_panel_4.insets = new Insets(0, 0, 5, 0);
//		gbc_panel_4.gridx = 0;
//		gbc_panel_4.gridy = 1;
//		panel_2.add(panel_4, gbc_panel_4);
//		panel_4.setLayout(new GridLayout(0, 4, 0, 0));
		
		JLabel lblNewLabel_3 = new JLabel("电话");
		gbCon.gridwidth = 1;
		gbLayout.setConstraints(lblNewLabel_3, gbCon);
		panel_2.add(lblNewLabel_3);
		lblNewLabel_3.setHorizontalAlignment(SwingConstants.RIGHT);
		
		textField_4 = new JTextField();
		gbLayout.setConstraints(textField_4, gbCon);
		panel_2.add(textField_4);
		textField_4.setColumns(8);
		
		JLabel lblNewLabel_4 = new JLabel("联系人");
		gbLayout.setConstraints(lblNewLabel_4, gbCon);
		panel_2.add(lblNewLabel_4);
		lblNewLabel_4.setHorizontalAlignment(SwingConstants.RIGHT);
		
		textField_5 = new JTextField();
		gbCon.gridwidth = GridBagConstraints.REMAINDER;
		gbLayout.setConstraints(textField_5, gbCon);
		panel_2.add(textField_5);
		textField_5.setColumns(8);
		
//		JPanel panel_5 = new JPanel();
//		GridBagConstraints gbc_panel_5 = new GridBagConstraints();
//		gbc_panel_5.fill = GridBagConstraints.BOTH;
//		gbc_panel_5.gridx = 0;
//		gbc_panel_5.gridy = 2;
//		panel_2.add(panel_5, gbc_panel_5);
//		panel_5.setLayout(new GridLayout(0, 4, 0, 0));
		
		JLabel lblNewLabel_2 = new JLabel("地址");
		gbCon.gridwidth = 1;
		gbLayout.setConstraints(lblNewLabel_2, gbCon);
		panel_2.add(lblNewLabel_2);
		lblNewLabel_2.setHorizontalAlignment(SwingConstants.RIGHT);
		
		textField_3 = new JTextField();
		gbCon.gridwidth = GridBagConstraints.REMAINDER;
		gbLayout.setConstraints(textField_3, gbCon);
		panel_2.add(textField_3);
		textField_3.setColumns(8);

	}
	public static void main(String[] args) {
//		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		CustomerPanel x = new CustomerPanel();
		JFrame frame = new JFrame();
		frame.getContentPane().add(x);
		frame.pack();
		frame.setVisible(true);
	}

}
/*
 package com.laozhao.deliveryManager.view.master;


import com.laozhao.deliveryManager.zgui.ZPanel;
import java.awt.BorderLayout;
import javax.swing.JTextField;
import javax.swing.JPanel;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.BoxLayout;
import java.awt.GridLayout;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;

public class CustomerPanel extends ZPanel {
	private JTextField textField;
	private JTable table;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;
	private JTextField textField_4;
	private JTextField textField_5;

	
	public CustomerPanel() {
		setLayout(new BorderLayout(0, 0));
		
		JPanel panel = new JPanel();
		add(panel, BorderLayout.NORTH);
		panel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
		
		textField = new JTextField();
		panel.add(textField);
		textField.setColumns(10);
		
		JButton button = new JButton("检索");
		panel.add(button);
		
		JScrollPane scrollPane = new JScrollPane();
		add(scrollPane, BorderLayout.CENTER);
		
		table = new JTable();
		scrollPane.setViewportView(table);
		
		JPanel panel_1 = new JPanel();
		add(panel_1, BorderLayout.EAST);
		panel_1.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_2 = new JPanel();
		add(panel_2, BorderLayout.SOUTH);
		panel_2.setLayout(new GridLayout(0, 1, 0, 0));
		
		JPanel panel_3 = new JPanel();
		panel_2.add(panel_3);
		panel_3.setLayout(new GridLayout(0, 4, 0, 0));
		
		JLabel lblNewLabel = new JLabel("编码");
		panel_3.add(lblNewLabel);
		lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);
		
		textField_1 = new JTextField();
		panel_3.add(textField_1);
		textField_1.setColumns(8);
		
		JLabel lblNewLabel_1 = new JLabel("名称");
		panel_3.add(lblNewLabel_1);
		lblNewLabel_1.setHorizontalAlignment(SwingConstants.RIGHT);
		
		textField_2 = new JTextField();
		panel_3.add(textField_2);
		textField_2.setColumns(8);
		
		JPanel panel_4 = new JPanel();
		panel_2.add(panel_4);
		panel_4.setLayout(new GridLayout(0, 4, 0, 0));
		
		JLabel lblNewLabel_3 = new JLabel("电话");
		panel_4.add(lblNewLabel_3);
		lblNewLabel_3.setHorizontalAlignment(SwingConstants.RIGHT);
		
		textField_4 = new JTextField();
		panel_4.add(textField_4);
		textField_4.setColumns(8);
		
		JLabel lblNewLabel_4 = new JLabel("联系人");
		panel_4.add(lblNewLabel_4);
		lblNewLabel_4.setHorizontalAlignment(SwingConstants.RIGHT);
		
		textField_5 = new JTextField();
		panel_4.add(textField_5);
		textField_5.setColumns(8);
		
		JPanel panel_5 = new JPanel();
		panel_2.add(panel_5);
		panel_5.setLayout(new GridLayout(0, 4, 0, 0));
		
		JLabel lblNewLabel_2 = new JLabel("地址");
		panel_5.add(lblNewLabel_2);
		lblNewLabel_2.setHorizontalAlignment(SwingConstants.RIGHT);
		
		textField_3 = new JTextField();
		panel_5.add(textField_3);
		textField_3.setColumns(8);

	}

}

 */